package com.hxstrive.demo2;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;

@SpringBootApplication
@Controller
public class Demo2Application {

    public static void main(String[] args) {
        SpringApplication.run(Demo2Application.class, args);
    }

    @RequestMapping("/")
    public String index(Map<String,Object> map) {
        map.put("title", "Spring Boot 集成 FreeMarker");
        map.put("date", new SimpleDateFormat(
                "yyyy-MM-dd HH:mm:ss").format(new Date()));
        return "index";
    }

}
